<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "bus_supplier".
 *
 * @property integer $supplier_id
 * @property string $supplier_name
 * @property string $supplier_contact
 * @property string $supplier_phone
 * @property string $supplier_remark
 * @property string $shop_id
 * @property string $boss_id
 * @property integer $del_flag
 * @property string $supplier_balance
 * @property string $supplier_give_balance
 */
class BusSupplier extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'bus_supplier';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['supplier_name', 'supplier_contact', 'supplier_phone', 'supplier_remark', 'shop_id', 'boss_id'], 'required'],
            [['shop_id', 'boss_id', 'del_flag'], 'integer'],
            [['supplier_balance', 'supplier_give_balance'], 'number'],
            [['supplier_name', 'supplier_remark'], 'string', 'max' => 255],
            [['supplier_contact'], 'string', 'max' => 45],
            [['supplier_phone'], 'string', 'max' => 11]
        ];
    }
    
    /* public function scenarios()
    {
        return [
            'addSupplier' => ['supplier_name', 'supplier_contact', 'supplier_phone','supplier_remark','supplier_balance','supplier_give_balance'],
        ];
    } */

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'supplier_id' => 'Supplier ID',
            'supplier_name' => 'Supplier Name',
            'supplier_contact' => 'Supplier Contact',
            'supplier_phone' => 'Supplier Phone',
            'supplier_remark' => 'Supplier Remark',
            'shop_id' => 'Shop ID',
            'boss_id' => 'Boss ID',
            'del_flag' => 'Del Flag',
            'supplier_balance' => 'Supplier Balance',
            'supplier_give_balance' => 'Supplier Give Balance',
        ];
    }
}
